<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'test.jsp' starting page</title>
    
	<meta charset="UTF-8">
    <meta name="keywords" content="keyword1,keyword2,keyword3">
    <meta name="description" content="this is my page">
    <meta name="content-type" content="text/html; charset=UTF-8">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

  </head>
  
  <body>
    <%	
    	Integer n1=(Integer)pageContext.getAttribute("n1");
    	if(n1==null) n1=0;
    	n1++;
    	pageContext.setAttribute("n1", n1);
    	
    	Integer n2=(Integer)request.getAttribute("n2");
    	if(n2==null) n2=0;
    	n2++;
    	request.setAttribute("n2", n2);
    	
    	Integer n3=(Integer)session.getAttribute("n3");
    	if(n3==null) n3=0;
    	n3++;
    	session.setAttribute("n3", n3);
    	
    	Integer n4=(Integer)application.getAttribute("n4");
    	if(n4==null) n4=0;
    	n4++;
    	application.setAttribute("n4", n4);
    %>
    pageContext的计数器：<%=n1 %><br/>
    request的计数器：<%=n2 %><br/>
    session的计数器：<%=n3 %><br/>
    application的计数器：<%=n4 %><br/>
    
    <form action="test/dotest.jsp" method="post" enctype="multipart/form-data">
    	商品名<input type="text" name="pname"/><br/>
    	商品价格<input type="text" name="price"/><br/>
    	商品封面<input type="file" name="pcover"/><br/>
    	<input type="submit" value="提交"/>
    </form>
  </body>
</html>
